# @file    : llama_index_test
# @time    : 2025/3/22
# @author  : yongpeng.yao
# @desc    :

from dotenv import load_dotenv

load_dotenv()
from llama_index.core import SimpleDirectoryReader

documents = SimpleDirectoryReader('data').load_data()

# 为文档建立索引
from llama_index.core import VectorStoreIndex

from deepseek_llm import DeepSeekLLM

llm = DeepSeekLLM()

index = VectorStoreIndex.from_documents(documents, llm=llm)

# 创建查询引擎
agent = index.as_query_engine()

# 两个查询问题
response = agent.query('PISSH支持台听力表用来干什么的')
print(response)


